FROM centos:7.6.1810
ADD jdk-8u241-linux-x64.tar.gz /usr/local/
ADD apache-maven-3.6.3-bin.tar.gz  /usr/local/
ENV JAVA_HOME /usr/local/jdk1.8.0_241
ENV PATH $JAVA_HOME/bin:$PATH
ENV MAVEN_HOME /usr/local/apache-maven-3.6.3
ENV PATH $MAVEN_HOME/bin:$PATH
COPY CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo
COPY docker-ce.repo /etc/yum.repos.d/docker-ce.repo
RUN mkdir -p /usr/share/jenkins \
    && mkdir -p /root/.kube \
    && yum clean all \
    && yum makecache \
    && yum install -y docker-ce git \
    && yum clean all 

COPY jenkins-slave /usr/local/bin/jenkins-slave
COPY slave.jar /usr/share/jenkins
COPY kubectl /usr/bin/kubectl


USER root

WORKDIR /home/jenkins

ENTRYPOINT ["jenkins-slave"]

